﻿using Luna.Model.Common;

namespace Luna.Data
{
    /// <summary>
    /// Generator for data interface IGeolocalisationData.
    /// </summary>
    public partial class Manager
    {
        public void Load(Luna.Data.Common.IGeolocalisationData data)
        {
            data.PK = Generator.GetGuid();
            data.DisplayName = Generator.GetString(50);
            data.ItemType = Generator.GetEnum<SearchItemType>();
            data.Longitude = Generator.GetDouble(90);
            data.Latitude = Generator.GetDouble(90);
        }

        public bool AreSame(Luna.Data.Common.IGeolocalisationData data1, Luna.Data.Common.IGeolocalisationData data2)
        {
            bool buffer = true;

            buffer &= data1.PK == data2.PK;
            buffer &= data1.ItemType == data2.ItemType;
            buffer &= data1.DisplayName == data2.DisplayName;
            buffer &= data1.Latitude == data2.Latitude;
            buffer &= data1.Longitude == data2.Longitude;
            return buffer;
        }
    }
}